package com.rd.student.jiaji.class2.shirui.linklist2;

import java.util.LinkedList;

import static com.rd.student.jiaji.class2.shirui.linklist2.Student.*;

public class LinkedListTest {

    public static void main(String[] args) {

        LinkedList list = new LinkedList();
        Student student1 = new Student("People1", "计算机", 2, "唱", 99);
        Student student2 = new Student("People2", "计算机", 2, "跳", 66);
        Student student3 = new Student("People3", "计算机", 2, "RAP", 10);
        Student student4 = new Student("People4", "物联网", 1, "篮球", 19);
        Student student5 = new Student("People5", "物联网", 1, "唱", 20);
        Student student6 = new Student("People6", "大数据", 3, "跳", 20);
        list.add(student1);
        list.add(student2);
        list.add(student3);
        list.add(student4);
        list.add(student5);
        list.add(student6);

        System.out.println("---------相同年龄的学生---------------");
        printAge(list, 20);

        System.out.println("---------相同专业的学生---------------");
        printMajor(list, "计算机");

        System.out.println("---------相同年级的学生---------------");
        printGrade(list, 1);

        System.out.println("---------所有人员汇总------------------");
        printAllName(list);

        System.out.println("-----------平均年龄-------------------");
        PingJunAge(list);
        System.out.println(PingJunAge(list));

        System.out.println("-----------------大于等于20岁------------");
        moreAge(list, 20);
        System.out.println("------------------小于等于20岁-----------");
        lessAge(list, 20);


    }
}
